<!DOCTYPE html>
<html lang="en">
<head>
    <meta charset="UTF-8">
    <meta http-equiv="X-UA-Compatible" content="IE=edge">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <title>Document</title>
    <script src="../public/js/vue.js"></script>
    <style>
        .textBack {
            color:#fff;
        }
        .textCol {
            background: #0785fd;
        }
    </style>
</head>
<body>
    <div id="app">
        <h1 :class="stateArr">{{message}}</h1>
        <h1 :class="[state]">{{message}}</h1>
        <button @click="getStyle">点击变sei</button>
    </div>
    <script>
        const app = new Vue({
            el:"#app",
            data(){
                return {
                    message:'芜湖起飞！',
                    state:"textCol",
                    stateArr:["textBack", "textCol"]
                }
            },
            methods:{
                getStyle() {
                    this.isState = !this.isState;
                }
            }
        })
    </script>
</body>
</html>